// Replication file for "Problem Solving and the Demand for Expert Information in Congress" //
// Legislative Studies Quarterly. Accepted 11/15/2020
// By E.J. Fagan and Zachary McGee //

// This file uses the latest data from the U.S. Policy Agendas Project from mid-2020. //
// All raw data is available at www.comparativeagendas.net/us // 


cd "" // Set WD

use crs_panel_analysis.dta, clear
xtset majortopic year

// Figure 1: Total New Unique CRS Reports by Issue, 1997-2017

graph hbar unique_count, over(topicname, sort(1)) 

// Figure 2: Attention to Issues in New and New and Revised CRS Reports, 1997-2017

xtline percent_revisions percent_unique, i(topicname) t(year) legend(rows(2) cols(1)) ytitle("Percent of Attention")

// Table 1: Panel Estimation of Change in CRS Report Policy Attention (t)

xtreg d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip // Model 1
xtreg d.percent_unique L1.percent_unique d.percent_nyt L1.percent_nyt // Model 1
xtreg d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip d.percent_nyt L1.percent_nyt // Model 1
xtreg d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip d.percent_hearings L1.percent_hearings d.percent_rc L1.percent_rc d.percent_nyt L1.percent_nyt // ' 

// **** Appendix **** //

// Figure A1: Frequency of New and Revised CRS Reports, 1997-2017

graph bar (sum) unique_count revision_count, over(year) legend(position(6) rows(1) cols(2)) ytitle("Reports")

// Figure A2: Total New and Revised CRS Reports by Policy Area, 1997-2017

graph hbar revision_count, over(topicname, sort(1)) 

// Appendix Table A1: Panel Estimation of CRS Report Policy Attention, Panel Corrected Standard Errors

xtpcse d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip // Model 1
xtpcse d.percent_unique L1.percent_unique d.percent_nyt L1.percent_nyt // Model 1
xtpcse d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip d.percent_nyt L1.percent_nyt // Model 1
xtpcse d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip d.percent_hearings L1.percent_hearings d.percent_rc L1.percent_rc d.percent_nyt L1.percent_nyt // ' 

// Appendix Table A2: Panel Estimation of Change in CRS Report Policy Attention, Fixed Effects

xtreg d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip, fe // Model 1
xtreg d.percent_unique L1.percent_unique d.percent_nyt L1.percent_nyt, fe // Model 1
xtreg d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip d.percent_nyt L1.percent_nyt, fe // Model 1
xtreg d.percent_unique L1.percent_unique d.percent_mip L1.percent_mip d.percent_nyt L1.percent_nyt d.percent_hearings L1.percent_hearings d.percent_rc L1.percent_rc , fe //
